package com.algorithm;

/**
 * @author: sun.hongliang
 * @create: 2019/07/02 14:36
 */
public class LinkListPrint {
    public static void printListNode(ListNode head) {
        ListNode p = head;
        StringBuilder sb = new StringBuilder();
        while (p != null) {
            sb.append(p.val);
            if (p.next != null) {
                sb.append("->");
            }
            p = p.next;
        }
        System.out.println(sb);
        System.out.println("==========================");
    }
}
